import React from 'react'
import { Divider } from 'antd'
import { LwjTable } from "components";
import moment from 'moment';
import LwjTable2 from 'components/LwjTable/LwjTable'
import { LwjButton } from "components";

const List = ({
  onShowDetail,
  onShowAudit,
  ...tableProps
}) => {
  const columns = [
    {
      title: '收付款单编号',
      dataIndex: 'num',
      key: 'num',
      width: "8%"
    }, {
      title: '收付款方',
      dataIndex: 'settlementerName',
      key: 'settlementerName',
      width: "5%"
    }, {
      title: '支付方式',
      dataIndex: 'paymentType',
      key: 'paymentType',
      width: "5%",
      render: (text, record, index) => (record.paymentType === "alipay_pc_direct" ? "线上充值(支付宝)" : record.paymentType === "wx_pub_qr" ? "线上充值(微信)" : record.paymentType)
    }, {
      title: '收入金额(元)',
      dataIndex: 'receipt',
      key: 'receipt',
      align: "right",
      width: "5%",
      render: (text, record, index) => (<span style={{color:'green'}}>+{record.receipt.toFixed(2)}</span>)
    }, {
      title: '支出金额(元)',
      dataIndex: 'paid',
      key: 'paid',
      align: "right",
      width: "5%",
      render: (text, record, index) => (<span style={{color:'red'}}>-{record.paid.toFixed(2)}</span>)
    }, {
      title: '支付凭证号',
      dataIndex: 'paymentNum',
      key: 'paymentNum',
      align: "right",
      width: "5%"
    }, {
      title: '操作人',
      dataIndex: 'handlerName',
      key: 'handlerName',
      width: "5%",
    }
    // ,
    //  {
    //   title: '支付时间',
    //   dataIndex: 'paymentTime',
    //   key: 'paymentTime',
    //   width: "5%",
    //   render: (text, record, index) => (moment(record.paymentTime).format("YYYY-MM-DD"))
    // }
    , {
      title: '操作时间',
      dataIndex: 'handleTime',
      key: 'handleTime',
      width: "5%",
      render: (text, record, index) => (moment(record.handleTime).format("YYYY-MM-DD"))

    }, {
      title: '操作',
      key: 'handle',
      width: "5%",
      render: (text, record) => (
        <span>
          <LwjButton
            tooltip="查看"
            type="primary"
            shape="circle"
            size="small"
            icon="eye"
            onClick={() => onShowDetail(record)} />
        </span>
      )
    }
  ];

  return (
    <div>
      {/* <LwjTable {...tableProps} columns={columns} /> */}
      <LwjTable2
        {...tableProps}
        columns={columns}
      />
    </div>
  )
};


export default List
